main(a,b,c,d,t)
{
	for(gets(&a);~scanf("%d%d",&a,&b);printf("%ld\n",1L*a*b/c))
	{
		c=a>b?a:b;
		d=a<b?a:b;
		while(d)
		{
			t=c%d;
			c=d;
			d=t;
		}
	}
}
